﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Pibby.Core.IO;
using Pibby.Core.Persistence;

using dogd;

namespace Pibby.Core.PortableMedia
{
    [Serializable]
    [Table("MediaDevice")]
    public class MediaPlayerSettings : Identifiable
	{
        [PrimaryKeyColumn("MediaDeviceID")]
        public int DbKey
        {
            get { return this.PrimaryKey.Value; }
            set { this.PrimaryKey.Value = value; }
        }

        public bool IsDbKeyValid
        {
            get { return this.PrimaryKey.IsValid; }
        }

        [IntegerColumn("Enabled")]
        public bool Enabled
		{
			get;
			set;
		}

		/// <summary>
		/// Name of the volume - drive letter may change
		/// </summary>
        [Column("VolumeName")]
		public string VolumeName
		{
			get;
			set;
		}

		/// <summary>
		/// Where to put files - may be root or sub-directory
		/// </summary>
        [Column("BaseFolder")]
        public string BaseFolder
		{
			get;
			set;
		}

		/// <summary>
		/// Split folders by name?
		/// </summary>
        public OrganizationOption OrganizationOption
		{
			get;
			set;
		}

        [IntegerColumn("OrganizationOption")]
        public int OrganizationOptionValue
        {
            get { return (int)this.OrganizationOption; }
            set { this.OrganizationOption = (OrganizationOption)value; }
        }

		/// <summary>
		/// Automatically safely-eject the drive after synch ???
		/// </summary>
        public EjectOption EjectOption
		{
			get;
			set;
		}

        [IntegerColumn("EjectOption")]
        public int EjectOptionValue
        {
            get { return (int)this.EjectOption; }
            set { this.EjectOption = (EjectOption)value; }
        }

		/// <summary>
		/// Automatically synch latest content to device?
		/// </summary>
		public TransferOption TransferOption
		{
			get;
			set;
		}

        [IntegerColumn("TransferOption")]
        public int TransferOptionValue
        {
            get { return (int)this.TransferOption; }
            set { this.TransferOption = (TransferOption)value; }
        }
	}
}
